<template>
  <div style="display: flex">
    <div>
      <CloudCascader
        style="width: 360px"
        :options="options"
        placeholder="Please select"
        @change="onChange"
      ></CloudCascader>
    </div>
    <div style="margin-left: 20px">
      v-model:
      <CloudCascader
        style="width: 360px"
        v-model="checked"
        :options="options"
        placeholder="Please select"
        @change="onChange"
      ></CloudCascader>
    </div>
  </div>
</template>

<script>
  export default {
    title: '1.基础用法',
    subTitle: '省市区级联。',
    data () {
      return {
        checked: [],
        options: [
          {
            value: 'zhejiang',
            label: 'Zhejiang',
            children: [
              {
                value: 'hangzhou',
                label: 'Hangzhou',
                children: [
                  {
                    value: 'xihu',
                    label: 'West Lake',
                    code: 752100,
                  },
                ],
              },
            ],
          },
          {
            value: 'jiangsu',
            label: 'Jiangsu',
            children: [
              {
                value: 'nanjing',
                label: 'Nanjing',
                children: [
                  {
                    value: 'zhonghuamen',
                    label: 'Zhong Hua Men',
                    code: 453400,
                  },
                ],
              },
            ],
          },
        ],
      }
    },
    methods: {
      onChange (value) {
        console.log(value);
        console.log('this.checked', this.checked)
      }
    }
  }
</script>

<style lang="scss">
</style>